home *** CD-ROM | disk | FTP | other *** search
- Path: news.ov.com!news
- From: glenn@ov.com (Fletcher.Glenn@ov.com)
- Newsgroups: comp.lang.c
- Subject: Re: Help Me !
- Date: 23 Feb 1996 21:41:44 GMT
- Organization: OpenVision
- Message-ID: <4glcao$lml@spanky.pls.ov.com>
- References: <4geh23$e3u@newsbf02.news.aol.com>
- Reply-To: glenn@ov.com
- NNTP-Posting-Host: foghorn.pls.ov.com
-
- In article e3u@newsbf02.news.aol.com, mackboring@aol.com (MackBoring) writes:
- >I need to create a program to display a list of the first 1000 prime
- >integers (starting with 2) you need test only odd numbers and for
- >divisibilty with odd numbers
-
-
- Your obvious homework problem caught my attention. Using the principles
- from my previous post, I wrote a program to calculate n primes where
- n is supplied as an argument to the program. This took about 1/2 hour.
- It took 14.1 seconds to calculate and print 10,000 primes. If 2 is the
- first prime, then the 10,000th is 104,729. The largest prime I had to
- divide by in order to prove this prime was 317.
-
- Fletcher.Glenn@ov.com
-
- PS - the 1000th prime is 7919. This took 0.9 seconds to calculate and print
- all 1000 numbers.
-
-
-